<template>
  <branch-base
    :loading-value="loadingValue"
    :title="title"
    :data="data"
    :close="close"
    :close-text="closeText"
    :skip="skip"
    :type="type"
    @click="handClick"
    @close="closeBranch"
  ></branch-base>
</template>

<script lang="ts" setup name="BranchNodeCard">
import useBranch from './hook'

interface BranchProps {
  title?: string,
  data?: Record<string, any>[],
  handEvent?: (node?) => void,
  close?: boolean,
  closeText?: string,
  type?: string,
  skip?: boolean
}

const props = withDefaults(defineProps<BranchProps>(), {
  title: '请选择您感兴趣的内容：',
  close: true,
  closeText: '关闭',
  handEvent: () => undefined,
  skip: true
})

const emit = defineEmits(['unmount']);

const { handClick, loadingValue } = useBranch(props, emit)


const closeBranch = () => emit('unmount');

</script>
